﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BFlatCompile.Nodes
{
	internal class BaseClassConstructorCall : Expression
	{
		public Expression[] Args { get; private set; }
		public Class BaseClass { get; private set; }

		public BaseClassConstructorCall(IList<Expression> args, Class baseClass)
		{
			this.BaseClass = baseClass;
			this.Args = args.ToArray();
		}

		public override void ResolveCode(Class c, Dictionary<object, object> parents)
		{
			foreach (Expression expression in this.Args)
			{
				expression.ResolveCode(c, parents);
			}
		}

		public override void ResolveClassToThis(Class c)
		{
			// base class constructor calls do not occur in static context
		}
	}
}
